<?php
/**
 *
 *
 *
 */
namespace Yz\modules\Generic;

class Action_SelectById
    extends Action_Select
    implements \Yz_Action_Interface
{

    /**
     *  @var int ?
     */
    protected $id;

    /**
     *  @param int id > 0
     *  @return this
     */
    public function setId( $id )
    {
        debug();
        $this->id = \Yz_Int::testPositive($id);
        return $this;
    }

    /**
     *  Modified SELECT statement creator
     *
     */
    protected function buildSelect()
    {
        $sql = parent::buildSelect();
        $sql
            ->where($this->primaryTable . ".id=:FetchById_id")
            ->bind("FetchById_id", $this->id);
        return $sql;
    }


}
